Weather imapact on corn growth:

  • Planting (March to June): not to cool, ideally a dry and warm soil. Cold and wet weather prevent good soil drainage; Drough is not a concern at this season while rainfall in the spring is likely to worsen the already water-logged field in Midwest
  • Silking (June to Aug): stress in this stage is going to hurt the yield deeply
  • Strong wind during the whole life cycle

Quick Reference:

  • What weather events are impacting the corn growth

https://www.farmprogress.com/corn/10-keys-high-corn-yields

  • What are the weather indecies:

https://climatedataguide.ucar.edu/climate-data/overview-climate-indices

Questions looking for in this analysis:

  • cold/freeze in March, April
  • rain in March, April, May
  • heat in June, July, Aug
  • drought in June, July, Aug
  • freeze in last December as a indicator for a spring outlook

Raw weather data gathered:

  • cooling degree of days: A cooling degree day is every degree that the mean temperature is above 65 degrees during a day. So, if the high temperature for the day is 95, and the minimum is 51, the average temperature for the day is 73. That would be 8 cooling degree days (73-65). Monthly average
  • heating degree of days:
  • precipitation: monthly precipitation average
  • palmer drought severity index (PDSI): The Palmer Drought Severity Index (PDSI), calculated from a combination of precipitation, temperature, and soil moisture data. It represents the accumulation or deficit of water over a long-term period, about 9 months. The PDSI is a standardized measure, ranging from about -10 (dry) to +10 (wet) with values below -3 representing severe to extreme drought. The PDSI was designed to be strongly auto-correlated in order to account for the impact of land memory on drought conditions
  • palmer z index (zndx): The Z-Index corresponds to monthly drought conditions with no memory to previous monthly deficits or surpluses, can be used to track short-term agricultural drought, since it responds quickly to changes in soil moisture.
  • tavg: monthly atmosphere temperature average
  • tmax: monthly atmosphere temperature max
  • tmin: monthly atmosphere temperature min

Weather features:

  • number of days below freeze criteria in March, April
  • number of days above heating criteria in June, July
  • total rainfall in March to Aug each year, looking for wet Mar, Apl, May and dry June, July, Aug
  • freeze in last December as a indicator for a spring outlook
## Rows: 96
## Columns: 8
## $ year     <dbl> 1924, 1925, 1926, 1927, 1928, 1929, 1930, 1931, 1932, 1933, …
## $ sp_rain  <dbl> 6.90, 5.58, 6.70, 8.63, 7.65, 9.25, 6.98, 6.67, 6.87, 8.40, …
## $ sp_tavg  <dbl> 48.45000, 52.99000, 50.23667, 51.20000, 50.90000, 51.19667, …
## $ sm_rain  <dbl> 7.35, 7.62, 8.57, 8.68, 10.50, 7.00, 6.08, 7.57, 8.51, 7.14,…
## $ sm_tavg  <dbl> 84.37333, 85.03000, 84.57333, 82.49000, 82.98000, 84.71000, …
## $ avg_pdsi <dbl> -0.3808333, -2.0600000, 0.4183333, 2.8366667, 2.7808333, 1.0…
## $ sp_z     <dbl> -0.2033333, -2.9566667, -0.9500000, 0.6566667, -0.1933333, 1…
## $ sm_z     <dbl> -0.75000000, -1.40333333, -0.04000000, 1.47000000, 3.3433333…
## Warning: Removed 1 row(s) containing missing values (geom_path).

## Warning: Removed 1 row(s) containing missing values (geom_path).

rank of biggest yield increase: 1994 2013 1989 1984 1992

rank of biggest yield increase: 1994 2013 1989 1984 1992

## Registered S3 method overwritten by 'xts':
##   method     from
##   as.zoo.xts zoo
Current year YIELD vs WEATHER

Current year YIELD vs WEATHER

ACREAGE-LEAD-1 vs WEATHER

ACREAGE-LEAD-1 vs WEATHER

Current year YIELD DIFFERENCE vs WEATHER

Current year YIELD DIFFERENCE vs WEATHER

PerformanceAnalytics::chart.Correlation(main[, c("acre_planted_corn_lead1", "sp_z", "sm_z", "sp_tavg", "sm_tavg", "sp_rain", "sm_rain")],  histogram=F)
Acreage, yield lead(1) vs spring Z-index, summer Z-index

Acreage, yield lead(1) vs spring Z-index, summer Z-index

<<<<<<< Updated upstream
## [1] 979496.5

## 7 x 1 sparse Matrix of class "dgCMatrix"
##                        1
## (Intercept) -164624816.5
## sp_z                 .  
## sm_z                 .  
## sp_tavg              .  
## sm_tavg        2863017.7
## sp_rain         608477.6
## sm_rain              .
##        [,1]
## 1 0.1567652
## [1] 0.0420768

## 7 x 1 sparse Matrix of class "dgCMatrix"
##                        1
## (Intercept) -791.5831355
## sp_z          13.9080018
## sm_z         -23.9356521
## sp_tavg       17.4693838
## sm_tavg       -5.1713727
## sp_rain        0.5537153
## sm_rain       49.8218887
##        [,1]
## 1 0.3397009

8/24

leads <- create_lead(main, "acre_planted_corn", 9)
main <- leads$data
col <- c("sm_tavg", "acre_planted_corn", leads$lead_col)
PerformanceAnalytics::chart.Correlation(main[, ..col],  histogram=F)

lags <- create_lag(main, "sm_tavg", 9)
main <- lags$data
col <- c("acre_planted_corn", lags$lag_col)
PerformanceAnalytics::chart.Correlation(main[, ..col],  histogram=F)

colnames(main) <- make.unique(names(main))
ggplot(main[year>1959,]) +
  geom_vline(xintercept = seq(1960, 2020, 5), color = "gray20") +
  geom_vline(xintercept = seq(1960, 2020, 1), color = "gray95") +
  geom_line(aes(x= year, y = sm_tavg/20-3, color = "summer temp")) +
  # geom_line(aes(x= year, y = acre_planted_corn/1E8, color = "acre current cropyear")) +
  geom_line(aes(x= year, y = acre_planted_corn_lead1/1E8, color = "acre lead crop year")) +
  theme_classic()
## Warning: Removed 1 row(s) containing missing values (geom_path).

=======
## [1] 133604.5

## 7 x 1 sparse Matrix of class "dgCMatrix"
##                        1
## (Intercept) -388904771.4
## sp_z            276776.8
## sm_z           1665011.9
## sp_tavg              .  
## sm_tavg        5474490.8
## sp_rain         975039.0
## sm_rain              .
##        [,1]
## 1 0.1879185
## [1] 0.1493175

## 7 x 1 sparse Matrix of class "dgCMatrix"
##                       1
## (Intercept) -844.680179
## sp_z           .       
## sm_z         -22.022703
## sp_tavg       12.969034
## sm_tavg       -3.029413
## sp_rain       14.104419
## sm_rain       49.093153
##        [,1]
## 1 0.3561923
>>>>>>> Stashed changes